#include <iostream>
#include <string>
// 包含SpireMS SDK头文件
#include <sms_core.h>


int main(int argc, char *argv[])
{
    sms::Publisher pub("/topic/image", "sensor_msgs::CompressedImage");
    
    cv::Mat img = cv::Mat::ones(480, 640, CV_8UC3) * 127;
    while (1)
    {
        nlohmann::json msg = sms::cvimg2sms(img);
        pub.publish(msg);
        sms::msleep(1000);
    }

    pub.join();
    return 0;
}

